package com.actionscriptclass.state
{
	import com.actionscriptclass.timer.TimerInvoker;
	
	public class Loop implements IState
	{
		private var _state:SetState;
		private var _timer:TimerInvoker;
		
		public function Loop(state:SetState,timer:TimerInvoker)
		{
			_state=state;
			_timer=timer;
		}
		
	    public function start():void
		{
		   _state.setState(_state.getStart());
           _timer.start();
		}
		
		public function stop():void
		{
		   _state.setState(_state.getStop());
	        _timer.stop();
		}
	
		public function loop(loopNumber:uint=1):void
		{
			 //do nothing	
		}
		
		public function pause():void
		{
		    _state.setState(_state.getPause());
	        _timer.pause();
		}
	}
}